<%-- 
    Document   : ListFlights
    Created on : Nov 1, 2011, 11:54:48 PM
    Author     : Mr-aUgust
--%>

<%@page pageEncoding="UTF-8"%>
<%@ page session="true" import="java.util.Collection,DAL.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/taglib139.tld" prefix="pg" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>East2West Tours and Travels</title>
       <style type="text/css">
            #Table
            {
            border:1px solid green;
            }
            th
            {
            border:1px solid green;
            background-color:green;
            color:white;
            }
            .td
            {
            border:1px solid green;
            }
            .font
            {
            font-family:"Times New Roman", Times, serif;
            font-size:x-large;
            font-weight:bold;
            width:200px;
            margin-left:auto;
            margin-right:auto;
            }
        </style>
    </head>
    <body>

    <h1>JSP Page</h1>
    <%
        session.removeAttribute("status");
        session.removeAttribute("statusH");
        
        FlightsBean cb=new FlightsBean();
        Collection fl=cb.ListFights();
        request.setAttribute("fls",fl);
        %>
    <div class="font">List Flights</div>    
        <table width="100%" id="Table">  
            <tr>
                <th>FlightID</th>
                <th>LocationID</th>
                <th>FlightName</th>
                <th>Departure_Time</th>
                <th>Arrival_Time</th>
                <th>Arrival_City</th>
                <th>Departure_City</th>
                <th>Price</th>
                <th>Edit</th>
                <th>Delete</th>
            </tr>
            <pg:paging pageSize="5" url="management.jsp?page=ListHotel">
                <c:forEach items="${fls}" var="cr">
                    <pg:item>
                        <tr>
                            <td class="td">${cr.flightID}</td>
                            <td class="td">${cr.nameCity}</td>
                            <td class="td">${cr.flightName}</td>
                            <td class="td">${cr.departure_Time}</td>
                            <td class="td">${cr.arrival_Time}</td>
                             <td class="td">${cr.arrival_City}</td>
                             <td class="td">${cr.departure_City}</td>
                            <td class="td"><f:formatNumber value="${cr.price}" pattern="$#,###" /></td>
                            <td class="td">
                                <form action="../ControllerDetailFlight" method="post">
                                    <input type="hidden" name="carID" value="${cr.flightID}" />
                                    <input type="submit" name="edit" value="Edit"/>
                                </form>
                            </td>
                            <td class="td">
                                <form action="../ControllerFlight" method="post">
                                    <input type="hidden" name="FlightID" value="${cr.flightID}" />
                                    <input type="submit" name="delete" value="Delete" OnClick="return confirm('Are you sure you want delete record this?');"/>
                                </form>
                            </td>
                        </tr>
                    </pg:item>       
                </c:forEach>
                <pg:index>
                    <pg:page><%=thisPage%></pg:page>
                </pg:index>
                <a href="InsertFlight.jsp">Add</a>
            </pg:paging>
                
        </table>
    </body>
</html>
